package com.summer.bilibiliLeetcode.singleton;
//单例模式（饿汉式）:坏处:对象加载时间过长  好处:线程安全
public class SingletonTest01 {
    public static void main(String[] args) {
        Bank bank1 = Bank.getInstance();
        Bank bank2 = Bank.getInstance();
        System.out.println(bank1 == bank2);

    }
}
class  Bank{
    private Bank (){}
    private static Bank instance = new Bank();
    public static Bank getInstance(){
        return instance;
    }
}
